﻿/**
<?xml version="1.0" encoding="UTF-8"?>
<root>
	<tactique id="1" display="4-4-1-1" >
		<position xpercent="50"  ypercent="2"   maillot="1" />
		<position xpercent="0"   ypercent="25"  maillot="2" />
		<position xpercent="100" ypercent="25"  maillot="3" />
		<position xpercent="65"  ypercent="25"  maillot="4" />
		<position xpercent="35"  ypercent="25"  maillot="5" />
		<position xpercent="35"  ypercent="50"  maillot="6" />
		<position xpercent="65"  ypercent="50"  maillot="7" />
		<position xpercent="95"  ypercent="60"  maillot="8" />
		<position xpercent="50"  ypercent="100" maillot="9" />
		<position xpercent="50"  ypercent="73"  maillot="10" />
		<position xpercent="5"   ypercent="60"  maillot="11" />
	</tactique>
</root>
*/
class Position {
	public var Joueur:Joueur;
	public var id:Number;
	public var _x:Number;
	public var _y:Number;
		
	public function Position() {}
	/**
	@param valX xpercent
	@param valY ypercent
	@param DEB_TERRAIN_X @see _global.DEB_TERRAIN_X = 21;
	@param DEB_TERRAIN_Y @see _global.DEB_TERRAIN_Y = 183;
	@param TERRAIN_X @see _global.TERRAIN_X = 600;
	@param TERRAIN_Y @see _global.TERRAIN_Y = 400;
	@param PHOTO_X @see _global.PHOTO_X = 150;
	@param PHOTO_Y @see _global.PHOTO_Y = 75;
	@param ROTATE @see _global.TERRAIN_ROTATE = 0; valeur par défaut
	*/
	public function setPosition(valX, valY, DEB_TERRAIN_X, DEB_TERRAIN_Y, TERRAIN_X, TERRAIN_Y, PHOTO_X, PHOTO_Y, ROTATE) {
		if (ROTATE != 1) {
			valX = 100 - valX;
			valY = 100 - valY;
		}
		var xMax = TERRAIN_X - PHOTO_X;
		var yMax = TERRAIN_Y - PHOTO_Y;
		this._x = DEB_TERRAIN_X + valX * xMax / 100;
		this._y = DEB_TERRAIN_Y + valY * yMax / 100;
	}
}